<UserControl x:Class="EdiDocuments.Views.StartPage.StartPageView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             
             xmlns:cmd="clr-namespace:Edi.Core;assembly=Edi.Core"
             xmlns:hyperl="clr-namespace:SimpleControls.Hyperlink;assembly=SimpleControls"

             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             
             xmlns:behav="clr-namespace:Edi.Core.Behaviour;assembly=Edi.Core"
             xmlns:view="clr-namespace:Files.Views.RecentFiles;assembly=Files"
             xmlns:cmdLabel="clr-namespace:Util.Local;assembly=Util"

             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="600" Background="{DynamicResource ToolViewBackground}"

             Focusable="True"
             KeyboardNavigation.IsTabStop="True"
             Name="StartPageViewObject"
             behav:KeyboardFocus.On="{Binding ElementName=StartPageViewObject}"
             ><!-- The KeyboardFocus attached property is necessary to support CTRL+TAB in AvalonDock -->
  <UserControl.Resources>
    <BitmapImage UriSource="pack://application:,,,/Themes;component/Images/App/StartPage/Edi100.png" x:Key="Logo" />
    <BitmapImage UriSource="pack://application:,,,/Themes;component/Images/App/StartPage/File_Open64.png" x:Key="FileOpenImage" />
    <BitmapImage UriSource="pack://application:,,,/Themes;component/Images/App/StartPage/File_New64.png" x:Key="NewFileImage" />
  </UserControl.Resources>
  <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="12" >
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <!-- Project Name -->
    <TextBlock Grid.Column="0"
               Grid.Row="0"
               HorizontalAlignment="Left" VerticalAlignment="Top"
               ToolTip="{x:Static cmdLabel:Strings.STR_STARTPAGE_VISITPROJECTHOMEPAGE_TT}">
        <Hyperlink TextDecorations="None" Command="cmd:AppCommand.BrowseURL">
          <TextBlock Text="Edi" FontSize="48" />
        </Hyperlink>
    </TextBlock>

    <Border Grid.Row="1"
            SnapsToDevicePixels="True"
            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
            BorderBrush="{DynamicResource StartPageBorderForegroundColor}" BorderThickness="1">

      <Grid Grid.Row="1" Margin="15" HorizontalAlignment="Center" Width="500">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
          </Grid.ColumnDefinitions>

          <TextBlock Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
          <Hyperlink TextDecorations="None" Command="New"
                     ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}">
            <Image Source="{DynamicResource Image_New}" Height="64" />
          </Hyperlink>
          </TextBlock>

          <TextBlock Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="9,0">
          <Hyperlink TextDecorations="None"
                     Command="Open"
                     ToolTip="{x:Static cmdLabel:Strings.STR_STARTPAGE_FILEOPEN_TT}">
            <Image Source="{DynamicResource Image_Open}" Height="64" />
          </Hyperlink>
          </TextBlock>
        </Grid>

        <view:RecentFilesView Grid.Row="2" Grid.ColumnSpan="2" MaxWidth="500" Margin="0, 12" />
      </Grid>
    </Border>

    <!-- Logo -->
    <TextBlock Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Right" VerticalAlignment="Top"
               ToolTip="{x:Static cmdLabel:Strings.STR_STARTPAGE_VISITPROJECTHOMEPAGE_TT}">
        <Hyperlink TextDecorations="None" Command="cmd:AppCommand.BrowseURL">
          <Image Source="{DynamicResource Logo}" Width="100" />
        </Hyperlink>
    </TextBlock>

  </Grid>
</UserControl>
